<?php

namespace plugins\rwechat\controller;

class AdminSettingController extends Controller
{
    public function index()
    {
        $config = cmf_get_option('rwechat');
        $this->assign('config', $config);
        return $this->fetch();
    }

    public function save()
    {
        $data = request()->post();
        if ($data) {
            cmf_set_option('rwechat', $data) ? $this->success('设置成功') : $this->error('保存失败');
        }
    }
}